Skip to content

Conversation

@elfedy
Copy link

@elfedy elfedy commented Nov 16, 2024

Sample of how we would remove foundry overrides using foundry-rs#224 changes.

Remaining code is a single zksync crate with artifacts and Compiler/ArtifactOutput implementations

NOTE: The PR is not meant to be actually merged with zksync-v0.11.6 but implemented when the following upstream changes are made. It is made to that branch for now for illustrative purposes.

Copy link
Collaborator

@hedgar2017 hedgar2017 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Would it now be possible to switch to era-solc?

@elfedy
Copy link
Author

elfedy commented Nov 19, 2024

Would it now be possible to switch to era-solc?

@hedgar2017 yes, we can give it a shot after this see how it goes.

mattsse pushed a commit to foundry-rs/compilers that referenced this pull request Dec 4, 2024
…ilerOutput (#224)

Right now the compiler abstraction has two couplings that force
foundry-zksync to implement it's [own fork of
compilers](https://github.com/Moonsong-Labs/compilers/tree/zksync-v0.11.6):
1. `Contract` is specific to `solc`/EVM contracts. Era VM contracts,
while requiring different fields, still could use most of the
functionality of the `compilers` pipeline.
2. `CompilerOutput` has `solc` specific fields. `zksolc` compilation has
relevant information that is useful to have later on, for example when
storing `BuildInfo`

This PR implements changes to address this. If implemented, it would
allow `foundry-zksync` (and potentially other non EVM implementations of
foundry) to get rid of all overrides and only maintain ZKsync specific
data structures/trait implementations. See [sample
PR](Moonsong-Labs#42). Changes
include:
1. Make `Compiler` generic over `Contract` (using `CompilerContract` as
a trait type).
2. Add `metadata` field to `CompilerOutput` in order to add arbitrary
data to compilation output.

---------

Co-authored-by: Nisheeth Barthwal <[email protected]>
Co-authored-by: Arsenii Kulikov <[email protected]>
alexandergrey33 added a commit to alexandergrey33/compilers that referenced this pull request Sep 17, 2025
…ilerOutput (#224)

Right now the compiler abstraction has two couplings that force
foundry-zksync to implement it's [own fork of
compilers](https://github.com/Moonsong-Labs/compilers/tree/zksync-v0.11.6):
1. `Contract` is specific to `solc`/EVM contracts. Era VM contracts,
while requiring different fields, still could use most of the
functionality of the `compilers` pipeline.
2. `CompilerOutput` has `solc` specific fields. `zksolc` compilation has
relevant information that is useful to have later on, for example when
storing `BuildInfo`

This PR implements changes to address this. If implemented, it would
allow `foundry-zksync` (and potentially other non EVM implementations of
foundry) to get rid of all overrides and only maintain ZKsync specific
data structures/trait implementations. See [sample
PR](Moonsong-Labs/compilers#42). Changes
include:
1. Make `Compiler` generic over `Contract` (using `CompilerContract` as
a trait type).
2. Add `metadata` field to `CompilerOutput` in order to add arbitrary
data to compilation output.

---------

Co-authored-by: Nisheeth Barthwal <[email protected]>
Co-authored-by: Arsenii Kulikov <[email protected]>
bug-knightxmiu70 added a commit to bug-knightxmiu70/compilers that referenced this pull request Sep 28, 2025
…ilerOutput (#224)

Right now the compiler abstraction has two couplings that force
foundry-zksync to implement it's [own fork of
compilers](https://github.com/Moonsong-Labs/compilers/tree/zksync-v0.11.6):
1. `Contract` is specific to `solc`/EVM contracts. Era VM contracts,
while requiring different fields, still could use most of the
functionality of the `compilers` pipeline.
2. `CompilerOutput` has `solc` specific fields. `zksolc` compilation has
relevant information that is useful to have later on, for example when
storing `BuildInfo`

This PR implements changes to address this. If implemented, it would
allow `foundry-zksync` (and potentially other non EVM implementations of
foundry) to get rid of all overrides and only maintain ZKsync specific
data structures/trait implementations. See [sample
PR](Moonsong-Labs/compilers#42). Changes
include:
1. Make `Compiler` generic over `Contract` (using `CompilerContract` as
a trait type).
2. Add `metadata` field to `CompilerOutput` in order to add arbitrary
data to compilation output.

---------

Co-authored-by: Nisheeth Barthwal <[email protected]>
Co-authored-by: Arsenii Kulikov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants